package com.common.core.constants;

public class CacheConstants {

    // ================== 认证相关 ==================
    /** 用户登录Token: auth:token:{token} */
    public final static String LOGIN_TOKEN_KEY = "auth:token:";
    
    /** 邮箱验证码: auth:email:code:{email} */
    public final static String EMAIL_CODE_KEY = "auth:email:code:";
    
    /** 邮箱发送时间限制: auth:email:time:{email} */
    public final static String EMAIL_TIME_KEY = "auth:email:time:";
    
    /** 验证码发送次数限制: auth:code:limit:{email} */
    public final static String CODE_TIME_KEY = "auth:code:limit:";

    // ================== 用户相关 ==================  
    /** 用户详情信息: user:profile:{userId} */
    public final static String USER_DETAIL = "user:profile:";
    
    /** 用户参与的竞赛列表: user:exam:list:{userId} */
    public final static String USER_EXAM_LIST = "user:exam:list:";
    
    /** 用户消息列表: user:message:list:{userId} */
    public final static String USER_MESSAGE_LIST = "user:message:list:";
    
    /** 用户上传次数: user:upload:times */
    public final static String USER_UPLOAD_TIMES_KEY = "user:upload:times";
    
    // ================== 竞赛相关 ==================
    /** 进行中的竞赛列表: exam:ongoing:list */
    public final static String EXAM_UNFINISHED_LIST = "exam:ongoing:list";
    
    /** 历史竞赛列表: exam:history:list */
    public final static String EXAM_HISTORY_LIST = "exam:history:list";
    
    /** 竞赛详情: exam:detail:{examId} */
    public final static String EXAM_DETAIL = "exam:detail:";
    
    /** 竞赛题目列表: exam:question:list:{examId} */
    public final static String EXAM_QUESTION_LIST = "exam:question:list:";
    
    /** 竞赛排行榜: exam:rank:list:{examId} */
    public final static String EXAM_RANK_LIST = "exam:rank:list:";
    
    // ================== 题目相关 ==================
    /** 题目列表: question:list */
    public final static String QUESTION_LIST = "question:list";
    
    /** 热门题目列表: question:hot:list */
    public final static String QUESTION_HOST_LIST = "question:hot:list";
    
    // ================== 消息相关 ==================
    /** 消息详情: message:detail:{messageId} */
    public final static String MESSAGE_DETAIL = "message:detail:";
    
    // ================== 配置常量 ==================
    /** Token过期时间(分钟) */
    public final static long EXP = 720;
    
    /** Token刷新时间(分钟) */
    public static final long REFRESH_TIME = 3;
    
    /** 用户信息缓存时间(分钟) */
    public final static long USER_EXP = 10;
    
    /** 默认分页起始位置 */
    public static final long DEFAULT_START = 0;
    
    /** 默认分页结束位置 */
    public static final long DEFAULT_END = -1;
}